package com.lzh.persevere.model.entity;


import com.baomidou.mybatisplus.annotation.TableName;
import com.lzh.persevere.common.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 系统异常日志表
 *
 * @author luzhiheng
 * @since 2025-08-04
 */
@TableName("sys_exception_log")
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "sys_exception_log", indexes = {})
public class SysExceptionLog extends BaseEntity {

    /**
     * IP地址
     */
    @Column(name = "ip", columnDefinition = "varchar(100) COMMENT 'IP地址'", nullable = false)
    private String ip;

    /**
     * IP属地
     */
    @Column(name = "ip_source", columnDefinition = "varchar(500) COMMENT 'IP属地'", nullable = false)
    private String ipSource;

    /**
     * 参数
     */
    @Column(name = "params", columnDefinition = "varchar(500) COMMENT '参数'", nullable = false)
    private String params;

    /**
     * 异常对象json格式
     */
    @Column(name = "exception_json", columnDefinition = "text COMMENT '异常对象json格式'", nullable = false)
    private String exceptionJson;

    /**
     * 异常简单信息,等同于e.getMessage
     */
    @Column(name = "exception_message", columnDefinition = "text COMMENT '异常简单信息,等同于e.getMessage'", nullable = false)
    private String exceptionMessage;

    /**
     * 请求接口
     */
    @Column(name = "request_interface", columnDefinition = "varchar(1024) COMMENT '请求接口'", nullable = false)
    private String requestInterface;

    /**
     * 请求方式
     */
    @Column(name = "request_way", columnDefinition = "varchar(50) COMMENT '请求方式'", nullable = false)
    private String requestWay;

    /**
     * 平台
     */
    @Column(name = "platform", columnDefinition = "varchar(200) COMMENT '平台'", nullable = false)
    private String platform;

    /**
     * 浏览器
     */
    @Column(name = "browser", columnDefinition = "varchar(200) COMMENT '浏览器'", nullable = false)
    private String browser;

}